import 'package:flutter/material.dart';
import '../../services/ScreenAdapter.dart';


class MinePage extends StatefulWidget {
  MinePage({Key? key}) : super(key: key);

  @override
  _MinePageState createState() => _MinePageState();
}

class _MinePageState extends State<MinePage> {
  // 头像+昵称
  Widget _getHeader() {
    return Container(
      width: double.infinity, // 宽度铺满
      child: AspectRatio(
        aspectRatio: 5/3,
        child: Card(
          color: Color(0xFFC6D4E3),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ClipOval( child: Image.asset(
                "images/2.jpeg",
                height: ScreenAdapter.height(100),
                width: ScreenAdapter.height(100),
                fit: BoxFit.cover,
              )),
              Padding(padding: EdgeInsets.only(top: ScreenAdapter.height(10))),
              Text("王各", style: TextStyle(fontSize: ScreenAdapter.height(40)),),
              Padding(padding: EdgeInsets.only(top: ScreenAdapter.height(20))),
              Row(children: [
                Expanded(
                  flex: 1,
                  child: Center(child: ListTile(
                    title: Text("我的主页", textAlign: TextAlign.center,),
                    subtitle: Text("关注/粉丝/获赞", textAlign: TextAlign.center,),
                  ),
                )),
                Expanded(
                  flex: 1,
                  child: Center(child: ListTile(
                    title: Text("我的资产", textAlign: TextAlign.center,),
                    subtitle: Text("积分/点券/游戏", textAlign: TextAlign.center,),
                  ),
                ))
              ],)
            ],
          ),
        ),
      ),
    );
  }


  @override
  Widget build(BuildContext context) {
    return ListView(
      children: [
        this._getHeader(), // 头像+昵称
      ],
    );
  }
}